"""
1. 遍历字典的键
# for 任意变量 in 字典变量：
for 任意变量 in 字典变量.keys(): # 和上面等价
    任意变量保存的是字典的键

2. 遍历字典的值
for 任意变量 in 字典变量.values():
    任意变量保存的是字典的值

3. 遍历字典的键和值
for 任意变量1, 任意变量2 in 字典变量.items():
    任意变量1保存的是字典的键
    任意变量2保存的是字典的值
"""

info = {"name": "tom", "age": 18, "gender": "男"}
# 1. 遍历字典的键
for k in info.keys():
    print(k)
print('=' * 50)
# 2. 遍历字典的值
for val in info.values():
    print(val)
# 3. 遍历字典的键和值
print('=' * 50)
for k, val in info.items():
    print(k, val)
